home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl1615.lha / add-defs next >
Text File  |  1991-03-25  |  2KB  |  75 lines

  1. #!/bin/sh
  2.  
  3. if [ $# -le 0 ]  ; then echo usage: Provide a machine name as arg ; exit 1 ; fi
  4.  
  5. if [ -f h/$1.defs ] ; then echo using $1.defs ;
  6.   else echo h/$1.defs does not exist
  7.   echo Build one or use one of `ls h/*.defs`
  8.   exit 1
  9. fi
  10.  
  11. echo $1 > machine
  12.  
  13.  
  14. if [ $# -ge 2 ] ; then
  15.    if [ -f $2/c/print.d ] ; then true ; else echo $2 is not the main kcl direct\
  16. ory ; fi ;fi
  17.  
  18.  
  19.  
  20. make -f Smakefile merge
  21.  
  22.  
  23.   echo "@s[# begin makedefs" > tmpxx
  24.   echo "@s,# end makedefs" >> tmpxx
  25.   echo "@s|# begin makedefs" >> tmpxx
  26.   rm -f makedefs
  27.   echo "AKCLDIR=`pwd`" > makedefs
  28.   echo "SHELL=/bin/sh" >> makedefs
  29.   echo "MACHINE=$1"  >> makedefs
  30.   cat h/$1.defs >> makedefs 
  31.   if  [ -f $2/c/print.d ] ; then echo MAINDIR = $2 >> makedefs ; fi
  32.   cat makedefs >> tmpxx    
  33.   echo "# end makedefs" >> tmpxx
  34.   echo "@s]" >> tmpxx
  35.   echo inserting h/$1.defs in ..
  36.   for v in  Smakefile mp/makefile V/makefile V/o/makefile V/lsp/makefile V/unixport/makefile  V/cmpnew/makefile  unixport/make_kcn ;
  37.   do
  38.   echo -n " $v,"
  39.  ./merge $v tmpxx tmp1
  40.   mv tmp1 $v
  41.   done
  42.  
  43. rm -f Vmakefile
  44.  
  45. rm -f tmpxx
  46.  
  47. echo ""
  48.  
  49. # Copy the config.h over.
  50.  
  51.  
  52. ./xbin/move-if-changed h/$1.h h/config.h
  53.  
  54.  
  55. # fix the cmpinclude.h
  56.  
  57. if fgrep "Begin for cmpinclud" h/$1.h > /dev/null ;
  58. then
  59. ./xbin/file-sub h/$1.h V/h/cmpinclude.h "Begin for cmpinclud" "End for cmpinclud"
  60. else
  61. echo "/* Begin for cmpinclude */" >tmp.h
  62. echo "/* End for cmpinclude */" >>tmp.h
  63. ./xbin/file-sub tmp.h V/h/cmpinclude.h "Begin for cmpinclud" "End for cmpinclud"
  64. rm -f tmp.h
  65. fi
  66. ./xbin/move-if-changed tmpx V/h/cmpinclude.h
  67. rm -f tmpx
  68.  
  69.  
  70.  
  71.  
  72. if [ -f xbin/$1-fix ] ; then xbin/$1-fix ; fi
  73.  
  74.  
  75.